<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="${#request.getContentType() + '/webcon/resources/'}"/>
    <meta charset="UTF-8">
    <title>定时采集</title>
    <link href="css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <style>
        .btn-large-dim {
            width: 80px;
            height: 80px;
            font-size: 10px;
            margin-bottom: 0px;
        }

        /*.left_content1 {
            height: 300px;
        }

        .left_content2 {
            height: 300px;
        }

        .right_content {
            height: 600px;
        }*/
    </style>


    <!--引入webuploader-->
   <!-- <link rel="stylesheet" type="text/css" href="widget/webuploader/webuploader.css">
    <script type="text/javascript" src="widget/webuploader/webuploader.min.js"></script>-->

    <!-- 引入ztree -->
    <link rel="stylesheet" href="widget/zTree/zTreeStyle/zTreeStyle.css"/>
    <script type="text/javascript" src="widget/zTree/jquery.ztree.all.min.js"></script>
    <!--<script type="text/javascript" src="myjs/tree.js"></script>

    <script type="text/javascript" src="myjs/task.js"></script>-->

    <script type="text/javascript" th:src="${#request.getContextPath() + '/commons/js/myztree.js'}"></script>
    <script type="text/javascript" th:src="${#request.getContextPath() + '/commons/js/myajax.js'}"></script>
    <script type="text/javascript" th:src="${#request.getContextPath() + '/commons/js/mytask.js'}"></script>
    <script type="text/javascript" th:src="${#request.getContextPath() + '/commons/js/task_collection.js'}"></script>


    <script th:inline="javascript">
        $(function () {

            //动态计算高度
            autoHeight();

            //初始化任务列表
            initCollTask();

        });
    </script>

    <!-- 音量选择控件 -->
    <link href="css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <script src="js/plugins/ionRangeSlider/ion.rangeSlider.min.js"></script>
    <script>
        $("#volume").ionRangeSlider({
            min: 0,
            max: 15,
            from: 0,
            postfix: "",
            prettify: false,
            hasGrid: false
        });

    </script>

    <!-- 日期插件 -->
    <link rel="stylesheet"
          th:href="${#request.getContextPath() + '/resources/widget/My97DatePicker/skin/WdatePicker.css'}"
          type="text/css"/>
    <script type="text/javascript"
            th:src="${#request.getContextPath() + '/resources/widget/My97DatePicker/WdatePicker.js'}"></script>


</head>
<body>
<!-- 顶部 -->
<div class="row border-bottom white-bg dashboard-header myheader" style="padding: 10px 10px 10px 10px">


    <button class="btn btn-primary dim btn-large-dim" type="button" onclick="open_Model(2);">
        <!-- data-toggle="modal" data-target="#myModal2" -->
        <img style="width: 50px; height: 50px; margin-bottom: 5px" src="icon/dscj_newtask.png"/><br/>
        新建任务
    </button>
    <!--<button class="btn btn-primary dim btn-large-dim" type="button" onclick="open_update_Model();">
        <img style="width: 50px; height: 50px; margin-bottom: 5px" src="icon/dscj_edittask.png"/><br/>
        编辑任务
    </button>
    <button class="btn btn-primary dim btn-large-dim" type="button" onclick="delete_task();">
        <img style="width: 50px; height: 50px; margin-bottom: 5px" src="icon/dscj_deltask.png"/><br/>
        删除任务
    </button>-->
    <button class="btn btn-primary dim btn-large-dim" type="button" onclick="isAction(1, 2);">
        <img style="width: 50px; height: 50px; margin-bottom: 5px" src="icon/dsyy_edittask.png"/><br/>
        编辑任务
    </button>
    <button class="btn btn-primary dim btn-large-dim" type="button" onclick="isAction(2, 2);">
        <img style="width: 50px; height: 50px; margin-bottom: 5px" src="icon/dsyy_deltask.png"/><br/>
        删除任务
    </button>
    <button class="btn btn-primary dim btn-large-dim" type="button" onclick="action_task();">
        <img style="width: 50px; height: 50px; margin-bottom: 5px" src="icon/dsyy_play.png"/><br/>
        手动执行
    </button>
    <button class="btn btn-primary dim btn-large-dim" type="button" onclick="stop_task();">
        <img style="width: 50px; height: 50px; margin-bottom: 5px" src="icon/dsyy_stop.png"/><br/>
        手动停止
    </button>
</div>
<!-- 工作区 -->
<div class="animated fadeInRight">
    <div class="row">
        <div class="col-lg-12" style="padding: 0px;">
            <div class="ibox float-e-margins">
                <div class="ibox-content  h_1" style="padding: 0px;">

                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>任务名称</th>
                            <th>任务状态</th>
                            <th>开始时间</th>
                            <th>持续时间</th>
                            <th>结束时间</th>
                           <!-- <th>播放类型</th>
                            <th>任务音量</th>
                            <th>任务进度</th>-->
                        </tr>
                        </thead>
                        <tbody id="task_list">
                        <!-- TODO 任务列表 -->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
    .checkbox-primary {
        float: left;
        margin-left: 10px;
    }

    .my-sroll {
        overflow: scroll;
        overflow-y: auto;
        overflow-x: auto;
    }

</style>

<!-- 弹出框 -->
<div class="modal inmodal" id="myModal2" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 50%">
        <!-- animated bounceInRight -->
        <!-- animated flipInY -->
        <div class="modal-content animated flipInY">
            <!-- 头部信息 -->
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">定时采集</h4>
            </div>
            <!-- 内容部分 -->
            <div class="modal-body" style="padding: 0px">
                <div class="row" style="margin: 0px;">
                    <div class="col-lg-6" style="padding: 4px;">
                        <div class="ibox float-e-margins" style="margin-bottom: 0px">
                            <div class="ibox-content" style="position: relative; height: 500px;">
                                <form class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">任务名称</label>
                                        <div class="col-lg-9">
                                            <input type="text" id="taskname" placeholder="任务名称" class="form-control">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">任务类型</label>
                                        <div class="col-lg-9">
                                            <select id="playOrder" class="select2_demo_1 form-control"
                                                    onclick="select_type(this.value, 2);">
                                                <option value="1">每天任务</option>
                                                <option value="2">每周任务</option>
                                                <option value="3">一次任务</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">开始日期</label>
                                        <div class="col-lg-9">
                                            <input id="startDate" type="text" placeholder="开始日期" class="form-control"
                                                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">开始时间</label>
                                        <div class="col-lg-9">
                                            <input id="startTime" type="text" placeholder="开始时间" class="form-control"
                                                   onclick="WdatePicker({dateFmt:'HH:mm'})">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">结束日期</label>
                                        <div class="col-lg-6">
                                            <input id="endTime" type="text" placeholder="结束时间" class="form-control"
                                                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" disabled="disabled">
                                        </div>
                                        <div class="col-lg-3">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox_end" type="checkbox"
                                                       onclick="open_end(this.checked);">
                                                <label for="checkbox_end">
                                                    开启
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">持续时间(默认10分钟)</label>
                                        <div class="col-lg-6">
                                            <input type="text" id="durtime" placeholder="600" class="form-control"
                                                   disabled="disabled">
                                        </div>
                                        <div class="col-lg-3">
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox_dur" type="checkbox"
                                                       onclick="open_dur(this.checked);">
                                                <label for="checkbox_dur">
                                                    开启
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label">采集终端</label>
                                        <div class="col-lg-9">
                                            <select id="collection_client" class="select2_demo_1 form-control"
                                                    onclick="">
                                            </select>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6" style="padding: 4px">
                        <div class="ibox float-e-margins" style="margin-bottom: 0px">
                            <div class="ibox-content my-sroll" style="height: 340px;">
                                <!-- 分控选择 -->
                                <form role="form" class="form-inline">
                                    <div class="form-group">
                                        <!-- <input type="text" placeholder="任务标识" id="taskname"
                                                class="form-control" style="width: 160px">-->
                                        <span style="width: 160px;">终端选择</span>
                                    </div>
                                    <div class="checkbox m-r-xs">
                                        <input type="checkbox" id="checkbox1" onclick="checkall(this.checked);">
                                        <label for="checkbox1">
                                            全选
                                        </label>
                                    </div>
                                </form>

                                <!-- 树形选择器 -->
                                <div id="ztree_div" class="ztree"
                                     style="height: 430px; overflow:scroll; overflow-y: auto; overflow-x: auto;"></div>
                            </div>
                        </div>
                        <div class="ibox float-e-margins" style="margin-bottom: 0px;">
                            <div class="ibox-content" style="height: 160px;">
                                <form class="form-horizontal">
                                  <!--  <div class="form-group">
                                        <label class="col-lg-3 control-label" style="padding-right: 0px">音量管理</label>
                                        <div class="col-lg-9">
                                            <label class="checkbox-inline"
                                                   style="width: 60%; margin-left: 0px; padding-left: 10px">
                                                <div id="volume"></div>
                                            </label>
                                        </div>
                                    </div>-->
                                    <div class="form-group">
                                        <label class="col-lg-3 control-label" style="padding-right: 0px">星期选择</label>
                                        <div class="col-lg-9">
                                            <!-- 星期选择 -->
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox2" name="week" type="checkbox" value="2"
                                                       disabled="disabled">
                                                <label for="checkbox2">
                                                    星期一
                                                </label>
                                            </div>
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox3" name="week" type="checkbox" value="4"
                                                       disabled="disabled">
                                                <label for="checkbox3">
                                                    星期二
                                                </label>
                                            </div>
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox4" name="week" type="checkbox" value="8"
                                                       disabled="disabled">
                                                <label for="checkbox4">
                                                    星期三
                                                </label>
                                            </div>
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox5" name="week" type="checkbox" value="16"
                                                       disabled="disabled">
                                                <label for="checkbox5">
                                                    星期四
                                                </label>
                                            </div>
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox6" name="week" type="checkbox" value="32"
                                                       disabled="disabled">
                                                <label for="checkbox6">
                                                    星期五
                                                </label>
                                            </div>
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox7" name="week" type="checkbox" value="64"
                                                       disabled="disabled">
                                                <label for="checkbox7">
                                                    星期六
                                                </label>
                                            </div>
                                            <div class="checkbox checkbox-primary">
                                                <input id="checkbox8" name="week" type="checkbox" value="128"
                                                       disabled="disabled">
                                                <label for="checkbox8">
                                                    星期日
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 底部按钮 -->
            <div class="modal-footer">
                <button type="button" id="submitBtn" class="btn btn-primary" onclick="submit_task();">提交</button>
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

</body>
</html>